test: cover native VM call argument packing#252
Draft
cursor[bot] wants to merge 1 commit into
Draft
Conversation
Co-authored-by: Tim Fox <timfox@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vmMainargument packing.VM_Callargument slot packing into the existingvm_native_modulehelper so the behavior is directly testable.tests/README.mdto includeunit_vm_native_modulein the unit target index.Risky behavior now covered
vmMaincalls with fewer than three arguments now have tests proving missing argument slots are zero-filled.Test files added/updated
tests/unit/test_vm_native_module.ctests/README.mdWhy this reduces regression risk
Recent native VM loading fixes made standalone/full-conversion native modules more important. A regression in
VM_Callargument packing can corrupt native UI/game module behavior, especially zero-argument calls like API-version probes that previously risked observing stack garbage. These unit tests pin that behavior without requiring game data or a graphics environment.Validation
cmake --build build-coverage --target unit_vm_native_module && ctest --test-dir build-coverage -R '^unit_vm_native_module$' --output-on-failure— passedcmake --build build-coverage --target idtech3_server— passed (pre-existingvm_x86.cvariadic macro warnings only)cmake --build build-coverage --target unit_macros unit_qmath unit_surfaceflags unit_qhelpers unit_crc unit_pathutil unit_msg unit_info unit_cm_bounds unit_parse unit_endian unit_vm_native_module && ctest --test-dir build-coverage -R '^unit_' --output-on-failure— 12/12 passed